'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)

	let baseUrl = 'https://www.0531yun.com';
	let monitorUrl = baseUrl + '/api/data/getRealTimeData';
	const res = await uniCloud.httpclient.request(monitorUrl, {
		headers: {
			'Content-Type': 'application/json; charset=UTF-8',
			'authorization': event.token
		},
		data: {},
		contentType: 'json', // 指定以application/json发送data内的数据
		dataType: 'json' // 指定返回值为json格式，自动进行parse
	})
	console.log("getMonitorCurrent res is: ", res);

	//返回数据给客户端
	return res.data;
};